import organApi from '@/biz/organization'

function createOrg(opt = {}, orgOpt) {
  // key data multiple hid
  return {
    title: opt.title || '所属组织',
    placeholder: opt.placeholder || '请选择组织',
    key: opt.key,
    disabled: opt.disabled,
    col: opt.col || 24,
    load: (o) => {
      organApi.getOrganization(orgOpt).then((res) => {
        o.cascader.options = res
      })
    },
    cascader: {
      options: [],
      changeOnSelect: opt.changeOnSelect
    },
    data: opt.data,
    rules: opt.rules,
    change: opt.change
  }
}
export default {
  createOrg
}
